package com.gloaba.logservice.config;

import com.gloaba.common.log.constant.LogMqConstants;
import org.springframework.amqp.core.Queue;
import org.springframework.amqp.core.QueueBuilder;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import java.util.HashMap;
import java.util.Map;

@Configuration
public class LogServiceMqConfig {

    @Bean(name = LogMqConstants.LOG_API_GATWEWAY_QUEUE)
    public Queue getLogMqQueue() {
        Map<String, Object> arguments = new HashMap<>();
        arguments.put(LogMqConstants.PRIORITY_KEY, LogMqConstants.PRIORITY_VALUE);
        return QueueBuilder.durable(LogMqConstants.LOG_API_GATWEWAY_QUEUE).withArguments(arguments).build();
    }
}
